package com.quan.demo.service.impl;

import com.quan.demo.dao.StudentDao;
import com.quan.demo.dao.StudentDaoCeshi;
import com.quan.demo.entity.Student;
import com.quan.demo.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author YC
 * @Description:
 * @date 2021/3/15 8:46
 */
@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentDao studentDao;
    @Autowired
    private StudentDaoCeshi studentDaoCeshi;

    @Override
    public void addStudent(Student student) {
//        studentDao.insert(student);
        studentDao.insertStudent(student);
    }


    @Override
    public void addStudentCeshi() {
        studentDao.addStudentCeshi(33,"1","1"," student");
    }

    @Override
    public void delStudent(Integer id) {
        studentDao.deleteByPrimaryKey(id);
    }

    @Override
    public void updateStudent(Student student) {
        studentDao.updateByPrimaryKey(student);
    }

    @Override
    public List<Student> getStudent() {
        return studentDao.selectAll();
    }

    @Override
    public void createDwbgjl() {
        int dwbgjl = studentDaoCeshi.createDwbgjl("1", "1", 3, "1", "1", " ROUND(");
        System.out.println(dwbgjl+" printlnprintlnprintlnprintlnprintln");
    }


}
